package ch.zhaw.swp1.model.message;

import ch.zhaw.swp1.model.message.address.SMSAddress;
import ch.zhaw.swp1.model.message.body.SMSBody;
import ch.zhaw.swp1.util.MultiChannelParser;

/**
 * Class representing an SMS message
 * @author Daniel Tiefenauer
 */
public class SMS extends Message {

	/**
	 * Default version
	 */
	private static final long serialVersionUID = 1L;

	/************************************************************************************/
	/* Constructors
	/*----------------------------------------------------------------------------------*/
	/**
	 * Default constructor
	 */
	public SMS() {
		setSender(new SMSAddress());
		setBody(new SMSBody());
	}
	
	/**
	 * Overloaded constructor with params
	 * @param recipientAddress user entered recipientLine
	 * @param senderAddress user entered sender address
	 * @param messageText user entered message text
	 */
	public SMS(String recipientAddress, String senderAddress, String messageText){
		setRecipients(MultiChannelParser.parseRecipients(recipientAddress, MessageType.SMS));
		setSender(new SMSAddress(senderAddress));
		setBody(new SMSBody(messageText));
	}
	
	/************************************************************************************/
	/* METHODS
	/*----------------------------------------------------------------------------------*/
	@Override
	public void addRecipient(String recipient) {
		recipients.add(new SMSAddress(recipient));
	}
	
	/************************************************************************************/
	/* START Setter/Getter
	/*----------------------------------------------------------------------------------*/
	@Override
	public void setSender(String sender) {
		setSender(new SMSAddress(sender));	
	}
	public void setBody(String text){
		setBody(new SMSBody(text));
	}
	public MessageType getMessageType(){
		return MessageType.SMS;
	}
	/*----------------------------------------------------------------------------------*/
	/* END Setter/Getter
	/************************************************************************************/




}
